package com.br.eaccount.code.service;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.br.eaccount.code.dao.CodeDao;
import com.br.eaccount.code.model.CommCodeModel;
import com.br.eaccount.code.model.CommGrpCodeModel;
import com.br.framework.exception.ServiceException;


@Service
public class CodeService {

		private final Logger logger = LoggerFactory.getLogger(getClass());
		
		@Autowired
		private CodeDao codeDao;
		
		/**
		 * @param cndModel
		 * @return
		 * @throws ServiceException
		 */
		@SuppressWarnings("unused")
		public List<CommGrpCodeModel> inqireGroupCodeList(CommGrpCodeModel grpCodeModel) throws ServiceException{
			logger.debug("::::::::::::::::::: inqireGroupcodeList::::::::::::::::");
			
			if(grpCodeModel==null){
				throw new ServiceException("error.notfound", new String[]{"코드"});
			}
			return codeDao.inqireGroupCodeList(grpCodeModel);
		}
		
		/**
		 * @param grpCodeModel
		 * @return
		 * @throws ServiceException
		 */
		public List<CommCodeModel> inqireCodeList(String grpCodeId)throws ServiceException{
			logger.debug("d:::::::::::::::: inqireCodeList :::::::::::::::");
			return codeDao.inqireCodeList(grpCodeId);
		}
	
}
